from xpinyin import Pinyin

def get_name_list(name, tname=0) :
    name_list = []
    resolver = Pinyin()
    result = resolver.get_pinyin(name)
    name_word = result.split('-')
    if len(name_word) == 3 :
        name_list.append([
            [name_word[0], name_word[1], name_word[2]], # zhangsanfeng
            [name_word[0], name_word[1][0], name_word[2][0]], # zhangsf
            [name_word[0][0], name_word[1][0], name_word[2][0]], # zsf
        ])
        name_list.append([
            [name_word[0]], # zhang
            [name_word[0][0]], # z
        ])
        name_list.append([
            [name_word[1], name_word[2]], # sanfeng
            [name_word[1][0], name_word[2][0]], # sf
        ])
        name_list.append([
            [name_word[0][0], name_word[1][0].upper(), name_word[2][0]], # zSf
            [name_word[0][0], name_word[1][0], name_word[2][0].upper()], # zsF
            [name_word[1], name_word[2], name_word[0]], # sanfengzhang
            [name_word[2], name_word[2]], # fengfeng sss
            ["xiao", name_word[0]], # xiaozhang ssss
            ["xiao", name_word[2]], # xiaofeng ssss
            name_word[0][0], name_word[0][0], name_word[0][0], name_word[1][0], name_word[2][0], # zzzsf sssss
        ])
    else :
        name_list.append([
            [name_word[0], name_word[1]], # zhangfeng
            [name_word[0], name_word[1][0]], # zhangf
            [name_word[0][0], name_word[1][0]], # zf
        ])
        name_list.append([
            [name_word[0]], # zhang
            [name_word[0][0]], # z
        ])
        name_list.append([
            [name_word[1]], # feng
            [name_word[1][0]], # f
        ])
        name_list.append([
            [name_word[0][0], name_word[1][0].upper()], # zF
            [name_word[1], name_word[1]], # fengfeng sss
            ["xiao", name_word[0]], # xiaozhang ssss
            ["xiao", name_word[1]], # xiaofeng ssss
            name_word[0][0], name_word[0][0], name_word[0][0], name_word[1][0], # zzzf sssss
        ])
    return name_list[tname]

def get_birth_list(birth, tbirth=0) :
    birth_list = [1, 2, 3, 4]
    if len(birth) != 8 :
        return []
    year = birth[:4]
    month = birth[4:6]
    day = birth[6:]
    birth_list[0] = [
        [year, month, day], # 19970207
    ]
    birth_list[1] = [
        [year[2:], month, day], # 970207

    ]
    birth_list[2] = [
        [month, day], # 0207

    ]
    birth_list[3] = [
        [year], # 1997
    ]
    if month[0] == '0' :
        birth_list[2].append(
            [month[1:], day], # 0823 -> 823
        )
    return birth_list[tbirth]

def get_card_list(id) :
    if len(id) == 18 :
        id_list = [
            id[-4:],
            id[-6:],
        ]
    else :
        id_list = []
    return id_list

def get_phone_list(phone) :
    if len(phone) == 11 :
        phone_list = [
            phone[-4:],
            phone[-5:],
        ]
    else :
        phone_list = []
    return phone_list

if __name__ == "__main__" :
    # name = input("name: ")
    # name_list = get_name_list(name)
    # print(name_list)
    birth = input("birth: ")
    birth_list = get_birth_list(birth)
    print(birth_list)
